<?php
    $this->assign('title','Grupo Despesa');
    $this->assign('page_local','Grupos Despesa');
    $this->assign('page_now','listagem');
    $this->assign('panel_title','Grupos Despesa');
    $this->start('content_filter');
    echo $this->Search->create('',array('class'=>'form-inline'));
?>
<div class="form-group">
    <?php
        echo $this->Search->input('tipo_despesa',array('class'=>'','autocomplete'=>'off'));
        echo $this->Search->input('filter1',array('class'=>'form-control','placeholder'=>'Nome Grupo','autocomplete'=>'off'));
    ?>
</div>
<?php
    echo $this->Search->button('Filtro',array('class'=>'btn btn-primary'));
    echo $this->Search->end();

    $this->end();
    $this->start('content_table');
    if(!empty($expenseGroups)):
        ?>
        <thead>
        <tr>
            <th class="col-sm-1">Tipo</th>
            <th>Nome</th>
            <th class="col-sm-1 text-center">#</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($expenseGroups as $expenseGroup): ?>
            <tr>
                <td><?php echo $this->Func->NomeTipo($expenseGroup['ExpenseGroup']['tipo_expense']); ?></td>
                <td><?php echo h($expenseGroup['ExpenseGroup']['name']); ?>&nbsp;</td>
                <td class="table-action">
                    <?php echo $this->Html->link('<i class="fa fa-eye"></i>', array('action' => 'view', $expenseGroup['ExpenseGroup']['id']),array("data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips",'escape'=>false,"title"=>"","data-original-title"=>"Ver Registro")); ?>

                    <?php echo $this->Html->link('<i class="fa fa-pencil"></i>', array('action' => 'edit', $expenseGroup['ExpenseGroup']['id']),array("data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips",'escape'=>false,"title"=>"","data-original-title"=>"Editar Registro")); ?>

                    <?php echo $this->Form->postLink('<i class="fa fa-trash-o"></i>', array('action' => 'delete', $expenseGroup['ExpenseGroup']['id']), array('escape'=>false,"title"=>"","data-original-title"=>"Deletar Registro","data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips"), __('Deseja realmente excluir o registro # %s?', $expenseGroup['ExpenseGroup']['name'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    <?php
    else:
        echo $this->Func->showMessage("Nenhum resultado foi encontrado em nossa base!",array('type'=>'info','close'=>false));
    endif;
    $this->end();
?>